/*
 * @Author: 抱着羊啃 1437670973@qq.com
 * @Date: 2025-03-29 19:00:02
 * @LastEditors: 抱着羊啃 1437670973@qq.com
 * @LastEditTime: 2025-04-16 00:33:24
 * @FilePath: \demo1\src\main\java\org\example\demo1\DAO\UserDao.java
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
package org.example.demo1.DAO;


import org.apache.ibatis.annotations.Param;
import org.example.demo1.Entity.User;

import java.util.List;
import java.util.Map;

public interface UserDao {
    List<User> getUserList();

    User getUserInformation(String username);

    void insertUser(@Param("username") String username, @Param("password") String password, @Param("email") String email, @Param("phone") String phone);

    void insertUserManager(Map<String, Object> params);


    User getUserInformationByPhone(String phone);

    User getUserInformationByPhoneAndUsername(@Param("username") String username, @Param("phone") String phone);


    User getUserInformationByEmail(String email);

    User getUserInformationByEmailAndUsername(@Param("username") String username, @Param("email") String email);


    void  updateUserInformation(@Param("username") String username, @Param("password") String password);

    List<User> getUserListPagination(Map<String, Object> params);

    int getUserCount(Map<String, Object> params);

    int deleteUser(String username);

    int updateUserInformationManage(Map<String, Object> params);

    // 新增：根据用户ID获取所有角色ID
    List<Integer> getRoleIdsByUserId(int user_id);
    // 新增：根据用户名获取用户信息（含角色）
    org.example.demo1.Entity.User getUserWithRolesByUsername(String username);

}
